print("------------ 定义基类 ------------")
class Cars {
    var speed = 0.0
    var desctiption: String {
        return "traveling at \(speed) niles per hour"
    }
    func makeNoise() {
        
    }
}

print("------------ 子类 ------------")
class Bicycle: Cars {
    var hasBasket = false
    // 重写父类的存储属性/实例属性
    override var desctiption: String {
        return super.desctiption + " and singing! \(self.speed)"
    }
    // 重写父类的实例方法
    override func makeNoise() {
        print("Bicycle dilingdiling!")
    }
}

let bicycle = Bicycle()
bicycle.hasBasket = true
bicycle.speed = 15
print("Bicycle: \(bicycle.desctiption)")
bicycle.makeNoise()
